
import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import get from '@dfeidao/atom-web/local/get';
// import set_node_cls from '@feidao/web/atom/browser/ui/set-node-cls';
import remove from '@dfeidao/atom-web/local/remove';
import fire from '@dfeidao/atom-web/msg/fire';
import error from '@dfeidao/atom-web/msgbox/error';
// import success from '@dfeidao/atom-web/msgbox/success';
// 确定
export default async function a001(fd: IFeidaoAiBrowserComponent) {
	const field = get(fd, 'field');
	const fieldtitle = get(fd, 'fieldtitle');

	if (!field || !fieldtitle) {
		error('请选择一条数据');
		// fire('zjc-000001', 'ec-001', 'fail', '请选择一条数据');
		// fire('zjc-000001', 'ec-001', 'fail', '请选择一条数据');
		return;
	}
	const compen = get(fd, 'compen') as string;
	const event = get(fd, 'event') as string;
	fire(compen, event, { field, fieldtitle });
	remove(fd, 'field');
	remove(fd, 'fieldtitle');

	fd.data.node.classList.add('display-n');
}
